﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraBars.Helpers;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;


namespace FRM_Main
{

    public partial class FRM_Main : XtraForm
    {
         public delegate void SendMessage(string Message);
        public SendMessage Sender1;
        public FRM_Main()
        {
            InitializeComponent();
            InitSkinGallery();
            InitGrid();
            Sender1 = new SendMessage(GetMessage);

        }
        private void GetMessage(string Message)
        {
            lblUserName.Text = Message;
        }

        void InitSkinGallery()
        {
            SkinHelper.InitSkinGallery(rgbiSkins, true);
        }
        BindingList<Person> gridDataList = new BindingList<Person>();
        void InitGrid()
        {
          
        }

        private void btnQuanLyND_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FRM_NguoiDung f = new FRM_NguoiDung();
            f.MdiParent = this;
            f.Show();
        }

        private void FRM_Main_Load(object sender, EventArgs e)
        {

        }

        private void FRM_Main_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FRM_DoiMK f = new FRM_DoiMK();
            f.Sender(lblUserName.Text);
            f.Show();
        }

        private void btnThoat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Application.Exit();
        }

        private void btnDangXuat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DialogResult result = MessageBox.Show("Bạn Có Muốn Đăng Xuất?", "Canh Bao", MessageBoxButtons.YesNo);
            if (result != DialogResult.No)
            {
                this.Hide();
                FRM_Login form = new FRM_Login();
                form.ShowDialog();
            }
        }

    }
}